package com.rms.recruit_management_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rms.recruit_management_system.mapper.TalentMapper;
import com.rms.recruit_management_system.pojo.Talent;
import com.rms.recruit_management_system.service.TalentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TalentServiceImpl extends ServiceImpl<TalentMapper,Talent> implements TalentService {
    @Autowired
    private TalentMapper talentMapper;
    @Override
    public void addToTalent(Talent talent) {
        talentMapper.insert(talent);
    }

    @Override
    public void delTalentById(int id) {
        talentMapper.deleteById(id);
    }

    @Override
    public Integer getTalentCount() {
        return Math.toIntExact(talentMapper.selectCount(null));
    }
}
